<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class date_duration</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#doxygen.gregorian_reference.greg__duration_8hpp" title="Header &lt;boost/date_time/gregorian/greg_duration.hpp&gt;">
<link rel="prev" href="structboost_1_1gregorian_1_1bad__day__of__year.html" title="Struct bad_day_of_year">
<link rel="next" href="structboost_1_1gregorian_1_1greg__durations__config.html" title="Struct greg_durations_config">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1gregorian_1_1bad__day__of__year.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#doxygen.gregorian_reference.greg__duration_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1gregorian_1_1greg__durations__config.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class date_duration</span></h2>
<p>boost::gregorian::date_duration — Durations in days for gregorian system. </p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../date_time/doxy.html#doxygen.gregorian_reference.greg__duration_8hpp" title="Header &lt;boost/date_time/gregorian/greg_duration.hpp&gt;">boost/date_time/gregorian/greg_duration.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">:</span>
  <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">date_time</span><span class="special">::</span><span class="identifier">date_duration</span><span class="special">&lt;</span> <span class="identifier">date_duration_rep</span> <span class="special">&gt;</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">base_type</span><span class="special">::</span><span class="identifier">duration_rep</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1aa2546f2fba2b71dd3ceee346fd778844"></a><span class="identifier">duration_rep</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#id-1_3_11_15_4_9_1_1_1_4-bb">public member functions</a></span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a5a85ed827af10dd255b057db0037019e"><span class="identifier">date_duration</span></a><span class="special">(</span><span class="identifier">duration_rep</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1acd35a24bc7ed6ccbb9e0460486399bca"><span class="identifier">date_duration</span></a><span class="special">(</span><span class="identifier">date_time</span><span class="special">::</span><span class="identifier">special_values</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a79754fec8ce89da2498d80d27c214bd3"><span class="identifier">date_duration</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">base_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a164b1dfadfb969e21add911af1a25455"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1aa1c238a53ae95b5c02b8520e29542ef9"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a5afc290e67ae87d0fb37d52d54ffb8e9"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a125032c69079ef16f5cb2220e766efe7"><span class="keyword">operator</span><span class="special">&gt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1abe3a4ddaca5529ba26b94e87a4dce4ee"><span class="keyword">operator</span><span class="special">&lt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1aaf4ee7fc9faf3178e16c808c106c5f48"><span class="keyword">operator</span><span class="special">&gt;=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a7543dfd7a43486e9e8bfa5340f80eace"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a1858b57125c5951490d62b3ee7e831e6"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a8077152653bcca0c2f930cff4ee1d34a"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1afc58bf55356384b42810705e7fb4e97a"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#id-1_3_11_15_4_9_1_1_1_5-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html#doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a137e99b235004fda6e455c80a2ad393f"><span class="identifier">unit</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.11.15.4.9.3.4"></a><h2>Description</h2>
<div class="refsect2">
<a name="id-1.3.11.15.4.9.3.4.2"></a><h3>
<a name="id-1_3_11_15_4_9_1_1_1_4-bb"></a><code class="computeroutput">date_duration</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a5a85ed827af10dd255b057db0037019e"></a><span class="identifier">date_duration</span><span class="special">(</span><span class="identifier">duration_rep</span> day_count <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>Construct from a day count. </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1acd35a24bc7ed6ccbb9e0460486399bca"></a><span class="identifier">date_duration</span><span class="special">(</span><span class="identifier">date_time</span><span class="special">::</span><span class="identifier">special_values</span> sv<span class="special">)</span><span class="special">;</span></pre>construct from special_values </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a79754fec8ce89da2498d80d27c214bd3"></a><span class="identifier">date_duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">base_type</span> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>Construct from another <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a>. </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a164b1dfadfb969e21add911af1a25455"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1aa1c238a53ae95b5c02b8520e29542ef9"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a5afc290e67ae87d0fb37d52d54ffb8e9"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a125032c69079ef16f5cb2220e766efe7"></a><span class="keyword">operator</span><span class="special">&gt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1abe3a4ddaca5529ba26b94e87a4dce4ee"></a><span class="keyword">operator</span><span class="special">&lt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="keyword">bool</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1aaf4ee7fc9faf3178e16c808c106c5f48"></a><span class="keyword">operator</span><span class="special">&gt;=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a7543dfd7a43486e9e8bfa5340f80eace"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Subtract another duration – result is signed. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a1858b57125c5951490d62b3ee7e831e6"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>Add a duration – result is signed. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a8077152653bcca0c2f930cff4ee1d34a"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>unary- Allows for dd = -date_duration(2); -&gt; dd == -2 </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <span class="special">&amp;</span> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1afc58bf55356384b42810705e7fb4e97a"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">int</span> divisor<span class="special">)</span><span class="special">;</span></pre>Division operations on a duration with an integer. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.11.15.4.9.3.4.3"></a><h3>
<a name="id-1_3_11_15_4_9_1_1_1_5-bb"></a><code class="computeroutput">date_duration</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <a class="link" href="classboost_1_1gregorian_1_1date__duration.html" title="Class date_duration">date_duration</a> <a name="doxygen.gregorian_reference.classboost_1_1gregorian_1_1date__duration_1a137e99b235004fda6e455c80a2ad393f"></a><span class="identifier">unit</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Returns the smallest duration – used by to calculate 'end'. </li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2001-2005 CrystalClear Software, Inc<p>Subject to the Boost Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="structboost_1_1gregorian_1_1bad__day__of__year.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#doxygen.gregorian_reference.greg__duration_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1gregorian_1_1greg__durations__config.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
